import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *

testCase="DBshop019_添加属性"
# 打开网址
firefox=openBrowser(urlAdmin)
#调用自定义函数进行后台的登录
DBshopLoginAdmin(firefox)
DBshopEnterMenu3(firefox,"商品管理","商品属性","属性")
firefox.find_element_by_link_text("添加属性").click()
from selenium.webdriver.support.select import Select
s=Select (firefox.find_element_by_id("attribute_group_id"))
s.select_by_visible_text("咕咕咕")
s=Select (firefox.find_element_by_id("attribute_type"))
s.select_by_visible_text("下拉")
firefox.find_element_by_id("attribute_name").send_keys("略略略")
firefox.find_element_by_xpath("//button").click()
#断言
try:
    firefox.find_element_by_xpath("//td[text()='略略略']")
    writeLog("%s 测试通过"%testCase)

except:
    writeLog("%s 测试失败" % testCase)
    getPhoto(firefox)


